package com.lingdian.fund.service.impl;

import org.springframework.stereotype.Service;

import com.lingdian.fund.service.Observer;
import com.lingdian.fund.service.SubjectService;

@Service("subjectService")
public class SubjectServiceImpl implements SubjectService{

	@Override
	public void addObserver(Observer observer) {
		observers.add(observer);
	}

	@Override
	public void removeObserver(Observer observer) {
		observers.remove(observer);
	}

	@Override
	public void notifyObserver() {
		for(Observer observer:observers){
			observer.update(this);
		}
	}

}
